package edu.xalead;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test1 {
    public static void main(String[] args) {
        BeanFactory factory = new ClassPathXmlApplicationContext("applicationContext.xml");
        //必须有一个工厂  工厂会把配置的 实例化 并且注入依赖
        PersonService personService =factory.getBean(PersonService.class);
        //用类型装配  从PersonService.class类中  获取bean
        personService.service();
    }
}
